import request from '@/utils/request'

export const getRoles = params => request.get('/sys/role', { params })

export const addRole = data => request.post('/sys/role', data)

export const updateRole = data => request.put(`/sys/role/${data.id}`, data)

export const delRole = id => request.delete(`/sys/role/${id}`)

export const getEnableRoles = () => request.get('/sys/role/list/enabled')

export const getRoleDetail = id => request.get(`/sys/role/${id}`)

export const assignPerm = data => request.put(`/sys/role/assignPrem`, data)
